<?php

class Application_Model_Users
{

    protected $_userId;

    protected $_emailAddress;

    protected $_password;

    protected $_firstName;

    protected $_lastName;

    protected $_address1;

    protected $_address2;

    protected $_city;

    protected $_state;

    protected $_country;

    protected $_zip;

    protected $_phone1;

    protected $_phone2;

    protected $_cell;

    protected $_email2;

    protected $_admin;

    protected $_resident;

    protected $_createdDate;

    protected $_createdBy;

    protected $_updatedDate;

    protected $_updatedBy;

    protected $_activeFlag;

    protected $_changePassword;

    public function setUserId($userId){
        $this->_userId= (int) $userId;
        return $this;
    }
    public function getUserId(){
        return $this->_userId;
    }

    public function setUserName($userName){
        $this->_userName= (string) $userName;
         return $this;
    }
    public function getUserName(){
        return $this->_userName;
    }

    public function setPassword($password){
        $this->_password= (string) $password;
         return $this;
    }
    public function getPassword(){
        return $this->_password;
    }

    public function setFirstName($firstName){
        $this->_firstName= (string) $firstName;
         return $this;
    }
    public function getFirstName(){
        return $this->_firstName;
    }

    public function setLastName($lastName){
        $this->_lastName= (string) $lastName;
         return $this;
    }
    public function getLastName(){
        return $this->_lastName;
    }

    public function setAddress1($address1){
        $this->_address1= (string) $address1;
         return $this;
    }
    public function getAddress1(){
        return $this->_address1;
    }

    public function setAddress2($address2){
        $this->_address2= (string) $address2;
         return $this;
    }
    public function getAddress2(){
        return $this->_address2;
    }

    public function setCity($city){
        $this->_city= (string) $city;
         return $this;
    }
    public function getCity(){
        return $this->_city;
    }

    public function setState($state){
        $this->_state= (string) $state;
         return $this;
    }
    public function getState(){
        return $this->_state;
    }

    public function setCountry($country){
        $this->_country= (string) $country;
         return $this;
    }
    public function getCountry(){
        return $this->_country;
    }

    public function setZip($zip){
        $this->_zip= (string) $zip;
         return $this;
    }
    public function getZip(){
        return $this->_zip;
    }

    public function setPhone1($phone1){
        $this->_phone1= (string) $phone1;
         return $this;
    }
    public function getPhone1(){
        return $this->_phone1;
    }

    public function setPhone2($phone2){
        $this->_phone2= (string) $phone2;
         return $this;
    }
    public function getPhone2(){
        return $this->_phone2;
    }

    public function setCell($cell){
        $this->_cell= (string) $cell;
         return $this;
    }
    public function getCell(){
        return $this->_cell;
    }

    public function setEmailAddress($emailAddress){
        $this->_emailAddress= (string) $emailAddress;
         return $this;
    }
    public function getEmailAddress(){
        return $this->_emailAddress;
    }

    public function setEmail2($email2){
        $this->_email2= (string) $email2;
         return $this;
    }
    public function getEmail2(){
        return $this->_email2;
    }

    public function setAdmin($admin){
        $this->_admin= (string) $admin;
         return $this;
    }
    public function getAdmin(){
        return $this->_admin;
    }

    public function setResident($resident){
        $this->_resident= (string) $resident;
         return $this;
    }
    public function getResident(){
        return $this->_resident;
    }

    public function setCreatedDate($createdDate){
        $this->_createdDate=  $createdDate;
         return $this;
    }
    public function getCreatedDate(){
        return $this->_createdDate;
    }

    public function setCreatedBy($createdBy){
        $this->_createdBy= (string) $createdBy;
         return $this;
    }
    public function getCreatedBy(){
        return $this->_createdBy;
    }

    public function setUpdatedDate($updatedDate){
        $this->_updatedDate= $updatedDate;
         return $this;
    }
    public function getUpdatedDate(){
        return $this->_updatedDate;
    }

    public function setUpdatedBy($updatedBy){
        $this->_updatedBy= (string) $updatedBy;
         return $this;
    }
    public function getUpdatedBy(){
        return $this->_updatedBy;
    }

    public function setActiveFlag($activeFlag){
        $this->_activeFlag= (string) $activeFlag;
         return $this;
    }
    public function getActiveFlag(){
        return $this->_activeFlag;
    }
    public function setChangePassword($changePassword){
        $this->_changePassword= (string) $changePassword;
         return $this;
    }
    public function getChangePassword(){
        return $this->_changePassword;
    }

    function createRandomPassword() {

            $chars = "abcdefghijkmnopqrstuvwxyz023456789";
            srand((double)microtime()*1000000);
            $i = 0;
            $pass = '' ;

            while ($i <= 7) {
                $num = rand() % 33;
                $tmp = substr($chars, $num, 1);
                $pass = $pass . $tmp;
                $i++;
            }

            return $pass;
    }
}

